﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// “空白页”项模板在 http://go.microsoft.com/fwlink/?LinkId=234238 上有介绍

namespace LikeBangumi.Pages
{
    /// <summary>
    /// 可用于自身或导航至 Frame 内部的空白页。
    /// </summary>
    public sealed partial class ACPage : Page
    {
        public ACPage()
        {
            this.InitializeComponent();
        }

        private void btn_Home_Click(object sender, RoutedEventArgs e)
        {
            pivot.SelectedIndex = Convert.ToInt32((sender as Button).Tag);
        }

        private void pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            UpdateUI();
            SolidColorBrush color = new SolidColorBrush(new Windows.UI.Color() { A = 255, B = 216, G = 123, R = 30 });
            switch (pivot.SelectedIndex)
            {
                case 0:
                    btn_Home.BorderBrush = color;
                    break;
                case 1:
                    btn_Tag.BorderBrush = color;
                    break;
                case 2:
                    btn_Seach.BorderBrush = color;
                    break;
                default:
                    break;
            }
        }


        private void UpdateUI()
        {
            SolidColorBrush color = new SolidColorBrush(new Windows.UI.Color() { A = 0, B = 0, G = 0, R = 0 });
            btn_Home.BorderBrush = color;
            btn_Seach.BorderBrush = color;
            btn_Tag.BorderBrush = color;
        }


    }
}
